/** @define Dropdown; use strict */

:root {
  --Dropdown-rhythm              : 1.5rem;
  --Dropdown-transition          : all .2s cubic-bezier(.175, .885, .320, 1.275);
  --Dropdown-z-index             : 100;
  --Dropdown-is-active-z-index   : 900;
  --Dropdown-content-color-bg    : #fff;
  --Dropdown-content-z-index     : 800;
  --Dropdown-title-size          : calc(14/16 * 1rem);
  --Dropdown-title-color         : color(#416988 tint(20%));
  --Dropdown-title-color-bg      : color(#416988 tint(90%));
  --Dropdown-item-color          : #4e9fdd;
  --Dropdown-item-hover-color    : var(--Dropdown-content-color-bg);
  --Dropdown-item-hover-color-bg : var(--Dropdown-item-color);
  --Dropdown-item-transition     : all .2s ease-out;
}

/* Need to stick to this naming convention (against suitcss) so that it does
not conflict with the other frontend code
 */

.EditorDropdown {
  position: relative;
  z-index: var(--Dropdown-z-index);
  display: inline-block;
  user-select: none;
}

.EditorDropdown.is-active {
  z-index: var(--Dropdown-is-active-z-index);
}

.Dropdown-toggleIcon {
  display: inline-block;
  transition: var(--Dropdown-transition);
  text-align: center;
}

.EditorDropdown.is-active .Dropdown-toggleIcon {
  transform: rotate(180deg);
}

.EditorDropdown-content {
  position: absolute;
  z-index: var(--Dropdown-content-z-index);
  top: 100%;
  left: 0;
  visibility: hidden;
  float: left;
  overflow: auto;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(var(--Dropdown-rhythm) * 17);
  min-width: 100%;
  margin: 0;
  padding: 0;
  transition: var(--Dropdown-transition);
  transform: translateY(-50%);
  text-align: left;
  opacity: 0;
  background-color: var(--Dropdown-content-color-bg);
  background-clip: padding-box;
  box-shadow: 0 0 var(--Dropdown-rhythm) rgba(0,0,0,0.1);
  border: 1px solid #639cad;
  border-bottom-width: 2px;
  border-top: none;
  border-radius: 8px;
}

.TransUnit-panelFooter .EditorDropdown-content {
  border: none;
}

.EditorDropdown.is-active > .EditorDropdown-content {
  visibility: visible;
  transform: translateY(0);
  opacity: 1;
}

.EditorDropdown-title {
  font-size: calc(14/16 * 1rem);
  padding: calc(var(--Dropdown-rhythm) * .125) calc(var(--Dropdown-rhythm) * .25);
  background-color: var(--Dropdown-title-color-bg);
  border-bottom: var(--Dropdown-content-border);
  color: var(--Dropdown-title-color);
}

.EditorDropdown-item {
  display: block;
  line-height: calc(var(--Dropdown-rhythm) * .875);
  padding: calc(var(--Dropdown-rhythm) * .25) calc(var(--Dropdown-rhythm) * .25);
  transition: var(--Dropdown-item-transition);
  color: var(--Dropdown-item-color);
}

.EditorDropdown-item:hover {
  color: var(--Dropdown-item-hover-color);
  background-color: var(--Dropdown-item-hover-color-bg);
}

.TransUnit-panelFooter .EditorDropdown-content .EditorButton {
  padding-right: 0.5rem;
}

/**
 * Modifiers
 */

.EditorDropdown--right .EditorDropdown-content {
  left: auto;
  right: 0;
}
